<template>
  <div>
    <tree-item class="item" :item="treeData"></tree-item>
  </div>
</template>

<script>
import TreeItem from "./TreeItem.vue";
import { tree } from "network/ksh";
export default {
  components: { TreeItem },
  data() {
    return {
      treeData: {},
    };
  },
  created() {
    this.treeFun();
  },
  methods: {
    async treeFun() {
      const { result } = await tree();
      this.treeData = result[0];
      this.treeName(result[0].name)
    },
    treeName(names) {
      this.$emit('setTreeName', names)
    }
  },
};
</script>
<style scoped>
.item {
  font-size: 1rem;
  color: #fff;
}
</style>